import java.util.Arrays;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        int[] arry = {1, 3, 9, 8, 4};
//        Arrays.sort(arry); 也可以用系统自带的方法
//        System.out.println(Arrays.toString(arry));
        ok(arry);
        System.out.println(Arrays.toString(arry));

    }
    public static void ok(int[] arry){
        int count = 1;
        for(int i = arry.length - 1;i >= 0;i--){
            for(int j = arry.length - 1;j >= 0;j--){
                if(arry[i] > arry[j]) {
                    int t = arry[i];
                    arry[i] = arry[j];
                    arry[j] = t;
                }
            }
        }
    }
}


